/**
 * Created by wanghuan on 2017/4/9.
 */

/*==========================who is working 相关接口==============================*/

import Ajax from '../../apiAjax';

export  default {
  state:{
    employeeStatusList:[] //员工状态列表
  },
  mutations:{
    setCommonStateData(state,{key,data}){
      state[key] = data;
    }
  },
  actions:{
    /**
     *查询打卡面板
     * @param commit
     * @param paramData = {}
     * @returns {Promise}
     */
    getEmployeeStatusList({commit},paramData){
      return new Promise((resolve, reject) => {
        Ajax({
          url:'/time/timesheet/getEmpsStatus',
          data:paramData,
          success:function (data) {
            commit('setCommonStateData',{key:'employeeStatusList',data:data.data});
            resolve(data);
          }
        })
      })
    }
  },
  getters: {
    //打卡数据
    employeeStatusList:(state, getters)=> {
      return state.employeeStatusList;
    }
  }
}
